<?php

namespace App\Admin\Controllers;

use App\Models\UserSignUp;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;

class UserSignUpController extends AdminController
{
    /**
     * Title for current resource.
     *
     * @var string
     */
    protected $title = '用户报名';


    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = new Grid(new UserSignUp());
        $grid->disableActions();
        $grid->disableRowSelector();
        $grid->disableCreateButton();

        $grid->column('id', __('Id'));
        $grid->column('user.name', '用户');
        $grid->column('course.name', '课程');
        $grid->column('status', '状态')->display(function ($status) {
            return UserSignUp::$statuses[$status];
        });
        $grid->column('created_at', '报名时间');
        $grid->column('pay_time', '支付时间');

        return $grid;
    }


}
